//
//  InputTempletSixTableViewCell.m
//  CedarFinancePH
//
//  Created by menchao on 2018/5/7.
//  Copyright © 2018年 cedarhd. All rights reserved.
//

#import "InputTempletSixTableViewCell.h"

@interface InputTempletSixTableViewCell ()



@end

@implementation InputTempletSixTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self!=nil){
        [self.contentView addSubview:self.titleLbl];
        [self.contentView addSubview:self.subTitleLbl];
        [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView).mas_offset(kMarginOffsetX);
            make.centerY.mas_equalTo(self.contentView);
        }];
        [self.subTitleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.titleLbl.mas_right).mas_offset(10);
            make.centerY.mas_equalTo(self.contentView);
        }];
    }
    return self;
}

- (void)updateTitle:(NSString *)title subtitle:(NSString *)subtitle{
    self.titleLbl.text = title;
    if(subtitle){
        self.subTitleLbl.text = subtitle;
    }
}

- (void)setRightView:(UIView *)rightView size:(CGSize)size{
    if (_rightView) {
        [_rightView removeFromSuperview];
    }
    _rightView = rightView;
    _rightView.clipsToBounds = YES;
    _rightView.layer.cornerRadius = size.height * 0.5;
    _rightView.backgroundColor = kWhiteColor;
    if(rightView){
        [self.contentView addSubview:_rightView];
        [_rightView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(self.contentView).mas_offset(-kMarginOffsetX);
            make.centerY.mas_equalTo(self.titleLbl);
            make.size.mas_offset(size);
        }];
    }
}


MACRO_UILabel_LazyloadWithPFCGFont(titleLbl, @"",kBlackColor, 14)
MACRO_UILabel_LazyloadWithPFCGFont(subTitleLbl, @"",kBlackColor, 14)


@end
